#pragma once
#include "IFactoryInterface.h"

class CPmkAlgorithm :	public IAlgorithm
{
public:
	CPmkAlgorithm(void);
	~CPmkAlgorithm(void);

	const wchar_t*
	get_name()const;

	bool
	initialize( void* data, size_t size );

	bool 
	set_algrithm_data( void* lpData, size_t size );

	bool
	start( void *userdata );

	void
	stop();

	static unsigned int __stdcall workthread( void* data );
private:
	void	*m_userdata;
	void	*m_data;
	void	*m_data_begin;
	size_t	m_mark;
	size_t	m_size;
	size_t	m_cursize;
	char	ssid[128];
	size_t	ssid_length;
	bool	work, started;

	char	szmsg[1024*8];
	unsigned int	tid;
	HANDLE			handle;
};

char* getline( void* data, char* buffer, size_t size );